﻿<h1>Getting Started</h1>
<hr />
<p>Add a reference to <strong>Build.Mvc.dll</strong></p>
<p>
    <strong>From the Nuget Package Manager Console, you can type this command:</strong><br />
    <h4>
        <pre>PM&gt; Install-Package Build.Mvc4</pre>
    </h4>
    <strong>Just add Build.Mvc.Html to your namespace imports in the web.config</strong>
    <pre>
&lt;system.web.webPages.razor&gt;
    &lt;host&quot; /&gt;
    &lt;pages pageBaseType=&quot;System.Web.Mvc.WebViewPage&quot;&gt;
        &lt;namespaces&gt;
            <span style="color: #006400;font-weight: bold">&lt;add namespace=&quot;Build.Mvc.Html&quot; /&gt;</span>
        &lt;/namespaces&gt;
    &lt;/pages&gt;
&lt;system.web.webPages.razor&gt;
</pre>
<p style="font-size: larger; margin: 2em 0;">
    <b>TIP:</b> There's a web.config in the root of each of your view folders!
</p>
<h1>Using Build.Mvc</h1>
<hr />
<h2>Add the method prefix "Build" to something like this</h2>
<div style="color: black; background-color: white;">
    <pre>@Html.ActionLink(<span style="color: #a31515;">"Cancel"</span>, <span style="color: #a31515;">"Index"</span>, <span style="color: #a31515;">"Home"</span>, <span style="color: blue;">null</span>, <span style="color: blue;">new</span> { data_icon = <span style="color: #a31515;">"arrow-l"</span>, data_rel = <span style="color: #a31515;">"back"</span> })
</pre>
</div>
<h2>Then you can do this</h2>
<div style="color: black; background-color: white;">
    <pre>@( Html.<span style="text-decoration: underline;">Build</span>ActionLink(<span style="color: #a31515;">"Cancel"</span>, <span style="color: #a31515;">"Index"</span>, <span style="color: #a31515;">"Home"</span>).
                Data(<span style="color: #a31515;">"icon"</span>, <span style="color: #a31515;">"arrow-l"</span>).
                Data(<span style="color: #a31515;">"rel"</span>, <span style="color: #a31515;">"back"</span>))
</pre>
</div>
<h2>Currently Supported Helpers</h2>
<p>View a list of <a style="text-decoration: underline;" href="/wikipage?title=Common%20Methods&amp;referringTitle=Documentation">Common Methods</a> for all Build extensions or other <a style="text-decoration: underline;" href="/wikipage?title=Tips&amp;referringTitle=Documentation">Tips</a> for using Build.Mvc</p>
<ol>
    <li><a style="text-decoration: underline;" href="/wikipage?title=RouteBuilding&amp;referringTitle=Documentation">ActionLink</a> </li>
    <li><a style="text-decoration: underline;" href="/wikipage?title=TextBox&amp;referringTitle=Documentation">TextBox</a> </li>
    <li>CheckBox </li>
    <li>RadioButton </li>
    <li><a style="text-decoration: underline;" href="/wikipage?title=DropDownList&amp;referringTitle=Documentation">DropDownList</a> </li>
    <li>Label </li>
    <li>Hidden </li>
    <li><a style="text-decoration: underline;" href="/wikipage?title=Form&amp;referringTitle=Documentation">Form</a> </li>
    <li>ValidationSummary </li>
    <li>ValidationMessage </li>
    <li><a style="text-decoration: underline;" href="/wikipage?title=Button&amp;referringTitle=Documentation">Button</a> </li>
    <li><a style="text-decoration: underline;" href="/wikipage?title=HtmlTagBuilder&amp;referringTitle=Documentation">BuildTag</a> </li>
</ol>
<h2>Extending Build.Mvc</h2>
<p>Build MVC can easily be extended... just add your own extensions!</p>
<div style="color: black; background-color: white;">
    <pre><span style="color: gray;">///</span> <span style="color: gray;">&lt;summary&gt;</span>
<span style="color: gray;">///</span><span style="color: green;"> This would add an Email() method which sets the type, placeholder text and tooltip</span>
<span style="color: gray;">///</span> <span style="color: gray;">&lt;/summary&gt;</span>
<span style="color: blue;">public</span> <span style="color: blue;">static</span> TBuilder Email&lt;TBuilder&gt;(<span style="color: blue;">this</span> TBuilder instance)
    <span style="color: blue;">where</span> TBuilder : ITextBoxBuilder
{
    <span style="color: blue;">return</span> instance.Attr(<span style="color: #a31515;">"type"</span>, <span style="color: #a31515;">"email"</span>).
        Placeholder(<span style="color: #a31515;">"yourname@your.com"</span>).
        Tooltip(<span style="color: #a31515;">"Enter your email"</span>);
}</pre>
</div>
<p>Or in VB.NET</p>
<div style="color: black; background-color: white;">
    <pre><span style="color: green;">''' &lt;summary&gt;</span>
<span style="color: green;">''' This would add an Email() method which sets the type, placeholder text and tooltip</span>
<span style="color: green;">''' &lt;/summary&gt;</span>
&lt;Extension()&gt;
<span style="color: blue;">Public</span> <span style="color: blue;">Function</span> Email(Of TBuilder <span style="color: blue;">As</span> ITextBoxBuilder)(instance <span style="color: blue;">As</span> TBuilder) <span style="color: blue;">As</span> TBuilder
    <span style="color: blue;">Return</span> instance.Attr(<span style="color: #a31515;">"type"</span>, <span style="color: #a31515;">"email"</span>).
        Placeholder(<span style="color: #a31515;">"yourname@your.com"</span>).
        Tooltip(<span style="color: #a31515;">"Enter your email"</span>)
<span style="color: blue;">End</span> <span style="color: blue;">Function</span></pre>
</div>
